package com.ysstech.valuation.controller;


import com.ysstech.common.annotation.YssLog;
import com.ysstech.common.annotation.YssPermissions;
import com.ysstech.common.controller.BaseController;
import com.ysstech.common.util.resultutil.RestResult;
import com.ysstech.common.util.resultutil.ResultGenerator;
import com.ysstech.valuation.entity.SecuritiesDealDetailed;
import com.ysstech.valuation.entity.StockDealDetailed;
import com.ysstech.valuation.service.StockDealDetailedService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author lishuangliang
 * @since 2021-02-22
 */
@Controller
@Slf4j
@Api(tags = "股票交易流水管理api")
@RequestMapping("/stockDealDetailed")
public class StockDealDetailedController extends BaseController {
    @Autowired
    private StockDealDetailedService stockDealDetailedService;

    @ApiOperation(value = "获取股票交易流水信息")
    @YssLog(module = "股票交易流水管理", remark = "获取股票交易流水信息")
    @PostMapping(value = "/queryDatas")
    @ResponseBody
    public List<StockDealDetailed> queryDatas(String accountId, String fdate) throws Exception {
        return stockDealDetailedService.queryDatas(accountId, fdate);
    }

    @ApiOperation(value = "获取股票交易流水信息")
    @YssLog(module = "股票交易流水管理", remark = "获取股票交易流水信息")
    @PostMapping(value = "/queryStockDealDetailed")
    @ResponseBody
    public Map<String, List<SecuritiesDealDetailed>> queryStockDealDetailed(@RequestBody StockDealDetailed stockDealDetailed) throws Exception {
        Map<String, List<SecuritiesDealDetailed>> map = stockDealDetailedService.queryStockDealDetailed(stockDealDetailed);
        return map;
    }

}
